package com.shudes.pt.container;

import java.util.*;

import com.shudes.pt.pojo.*;

public class GamePlayerContainer {
	
	protected Game game; 
	protected Map<Player, GamePlayer> gamePlayers;
	
	public GamePlayerContainer(Game g, Collection<GamePlayer> gps) {
		this.game=g;
		
		gamePlayers = new HashMap<Player, GamePlayer>(); 
		for(GamePlayer gp : gps) {
			gamePlayers.put(gp.getPlayer(), gp); 
		}
	}
	
	GamePlayerContainer(Game g) {
		this.game = g; 
		this.gamePlayers = new HashMap<Player, GamePlayer>(); 
	}
	
	public Player getHero() { 
		return game.getRealPlayer(); 
	}
	
	public Game getGame() { 
		return game;
	}
	
	public GamePlayer getHerosAction() { 
		return gamePlayers.get(getHero()); 
	}		
	
	void addGamePlayer(GamePlayer gp) { 
		gamePlayers.put(gp.getPlayer(), gp); 
	}

}
